package com.ruoyi.business.component.mqconsumer.repaymentconsumers;

import com.ruoyi.bizsys.utils.BizConstants;
import com.ruoyi.sms.common.SpringContextUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.ApplicationContext;
import org.springframework.stereotype.Component;

import java.util.HashMap;
import java.util.Map;

/**
 * 处理MQ还款的工厂类
 * @author wqg
 * @description
 * @date 2022/5/21
 */
@Component
public class RepaymentMqFactory {
    @Autowired
    private Map<String, IRepaymentMqService> repaymentMqServices;

    public IRepaymentMqService getHandle(String type) throws Exception {
        IRepaymentMqService serviceHandler = repaymentMqServices.get(type);
        if (null == serviceHandler) {
            throw new Exception("方法不存在～，static需要声明！");
        }
        return serviceHandler;
    }
}
